\(\int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx\) [754]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 28, antiderivative size = 69 \[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=\frac {(1-i) \sqrt {a} \text {arctanh}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right ) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}}{d} \]

[Out]

(1-I)*arctanh((1+I)*a^(1/2)*tan(d*x+c)^(1/2)/(a+I*a*tan(d*x+c))^(1/2))*a^(1/2)*cot(d*x+c)^(1/2)*tan(d*x+c)^(1/
2)/d

Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {4326, 3625, 211} \[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=\frac {(1-i) \sqrt {a} \sqrt {\tan (c+d x)} \sqrt {\cot (c+d x)} \text {arctanh}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d} \]

[In]

Int[Sqrt[Cot[c + d*x]]*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((1 - I)*Sqrt[a]*ArcTanh[((1 + I)*Sqrt[a]*Sqrt[Tan[c + d*x]])/Sqrt[a + I*a*Tan[c + d*x]]]*Sqrt[Cot[c + d*x]]*S
qrt[Tan[c + d*x]])/d

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 3625

Int[Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]]/Sqrt[(c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[
-2*a*(b/f), Subst[Int[1/(a*c - b*d - 2*a^2*x^2), x], x, Sqrt[c + d*Tan[e + f*x]]/Sqrt[a + b*Tan[e + f*x]]], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 4326

Int[(cot[(a_.) + (b_.)*(x_)]*(c_.))^(m_.)*(u_), x_Symbol] :> Dist[(c*Cot[a + b*x])^m*(c*Tan[a + b*x])^m, Int[A
ctivateTrig[u]/(c*Tan[a + b*x])^m, x], x] /; FreeQ[{a, b, c, m}, x] &&  !IntegerQ[m] && KnownTangentIntegrandQ
[u, x]

Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx \\ & = -\frac {\left (2 i a^2 \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}\right ) \text {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d} \\ & = \frac {(1-i) \sqrt {a} \text {arctanh}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right ) \sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)}}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.23 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.07 \[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=\frac {\sqrt {2} a \text {arctanh}\left (\frac {\sqrt {2} \sqrt {i a \tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d \sqrt {\cot (c+d x)} \sqrt {i a \tan (c+d x)}} \]

[In]

Integrate[Sqrt[Cot[c + d*x]]*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

(Sqrt[2]*a*ArcTanh[(Sqrt[2]*Sqrt[I*a*Tan[c + d*x]])/Sqrt[a + I*a*Tan[c + d*x]]])/(d*Sqrt[Cot[c + d*x]]*Sqrt[I*
a*Tan[c + d*x]])

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 347 vs. \(2 (56 ) = 112\).

Time = 34.46 (sec) , antiderivative size = 348, normalized size of antiderivative = 5.04

method result size
default \(-\frac {i \sqrt {2}\, \left (2 i \arctan \left (\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}+1\right )+2 i \arctan \left (\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}-1\right )+i \ln \left (\frac {\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}+\csc \left (d x +c \right )-\cot \left (d x +c \right )-1}{-\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}+\csc \left (d x +c \right )-\cot \left (d x +c \right )-1}\right )-\ln \left (\frac {-\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}+\csc \left (d x +c \right )-\cot \left (d x +c \right )-1}{\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}+\csc \left (d x +c \right )-\cot \left (d x +c \right )-1}\right )-2 \arctan \left (\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}+1\right )-2 \arctan \left (\sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}\, \sqrt {2}-1\right )\right ) \left (\sqrt {\cot }\left (d x +c \right )\right ) \sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \sin \left (d x +c \right )}{2 d \left (i \cos \left (d x +c \right )+i-\sin \left (d x +c \right )\right ) \sqrt {\cot \left (d x +c \right )-\csc \left (d x +c \right )}}\) \(348\)

[In]

int(cot(d*x+c)^(1/2)*(a+I*a*tan(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*I/d*2^(1/2)*(2*I*arctan((cot(d*x+c)-csc(d*x+c))^(1/2)*2^(1/2)+1)+2*I*arctan((cot(d*x+c)-csc(d*x+c))^(1/2)
*2^(1/2)-1)+I*ln(((cot(d*x+c)-csc(d*x+c))^(1/2)*2^(1/2)+csc(d*x+c)-cot(d*x+c)-1)/(-(cot(d*x+c)-csc(d*x+c))^(1/
2)*2^(1/2)+csc(d*x+c)-cot(d*x+c)-1))-ln((-(cot(d*x+c)-csc(d*x+c))^(1/2)*2^(1/2)+csc(d*x+c)-cot(d*x+c)-1)/((cot
(d*x+c)-csc(d*x+c))^(1/2)*2^(1/2)+csc(d*x+c)-cot(d*x+c)-1))-2*arctan((cot(d*x+c)-csc(d*x+c))^(1/2)*2^(1/2)+1)-
2*arctan((cot(d*x+c)-csc(d*x+c))^(1/2)*2^(1/2)-1))*cot(d*x+c)^(1/2)*(a*(1+I*tan(d*x+c)))^(1/2)*sin(d*x+c)/(I*c
os(d*x+c)+I-sin(d*x+c))/(cot(d*x+c)-csc(d*x+c))^(1/2)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 217 vs. \(2 (51) = 102\).

Time = 0.28 (sec) , antiderivative size = 217, normalized size of antiderivative = 3.14 \[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=\frac {1}{4} \, \sqrt {-\frac {8 i \, a}{d^{2}}} \log \left ({\left (\sqrt {2} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {8 i \, a}{d^{2}}} + 4 i \, a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - \frac {1}{4} \, \sqrt {-\frac {8 i \, a}{d^{2}}} \log \left ({\left (\sqrt {2} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {8 i \, a}{d^{2}}} + 4 i \, a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) \]

[In]

integrate(cot(d*x+c)^(1/2)*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

1/4*sqrt(-8*I*a/d^2)*log((sqrt(2)*(I*d*e^(2*I*d*x + 2*I*c) - I*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt((I*e^
(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) - 1))*sqrt(-8*I*a/d^2) + 4*I*a*e^(I*d*x + I*c))*e^(-I*d*x - I*c))
- 1/4*sqrt(-8*I*a/d^2)*log((sqrt(2)*(-I*d*e^(2*I*d*x + 2*I*c) + I*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt((I
*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) - 1))*sqrt(-8*I*a/d^2) + 4*I*a*e^(I*d*x + I*c))*e^(-I*d*x - I*c
))

Sympy [F]

\[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \sqrt {\cot {\left (c + d x \right )}}\, dx \]

[In]

integrate(cot(d*x+c)**(1/2)*(a+I*a*tan(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(I*a*(tan(c + d*x) - I))*sqrt(cot(c + d*x)), x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 374 vs. \(2 (51) = 102\).

Time = 0.38 (sec) , antiderivative size = 374, normalized size of antiderivative = 5.42 \[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {\sqrt {a} {\left (-\left (2 i + 2\right ) \, \arctan \left (2 \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right ) + 2 \, \sin \left (d x + c\right ), 2 \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right ) + 2 \, \cos \left (d x + c\right )\right ) + \left (i - 1\right ) \, \log \left (4 \, \cos \left (d x + c\right )^{2} + 4 \, \sin \left (d x + c\right )^{2} + 4 \, \sqrt {\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1} {\left (\cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right )^{2} + \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right )^{2}\right )} + 8 \, {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} - 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} {\left (\cos \left (d x + c\right ) \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right ) + \sin \left (d x + c\right ) \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) - 1\right )\right )\right )}\right )\right )}}{2 \, d} \]

[In]

integrate(cot(d*x+c)^(1/2)*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

-1/2*sqrt(a)*(-(2*I + 2)*arctan2(2*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 - 2*cos(2*d*x + 2*c) + 1)^(1/4)*si
n(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) - 1)) + 2*sin(d*x + c), 2*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2
*c)^2 - 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) - 1)) + 2*cos(d*x + c
)) + (I - 1)*log(4*cos(d*x + c)^2 + 4*sin(d*x + c)^2 + 4*sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 - 2*cos(
2*d*x + 2*c) + 1)*(cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) - 1))^2 + sin(1/2*arctan2(sin(2*d*x + 2*
c), cos(2*d*x + 2*c) - 1))^2) + 8*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 - 2*cos(2*d*x + 2*c) + 1)^(1/4)*(co
s(d*x + c)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) - 1)) + sin(d*x + c)*sin(1/2*arctan2(sin(2*d*x +
 2*c), cos(2*d*x + 2*c) - 1)))))/d

Giac [F]

\[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=\int { \sqrt {i \, a \tan \left (d x + c\right ) + a} \sqrt {\cot \left (d x + c\right )} \,d x } \]

[In]

integrate(cot(d*x+c)^(1/2)*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(I*a*tan(d*x + c) + a)*sqrt(cot(d*x + c)), x)

Mupad [F(-1)]

Timed out. \[ \int \sqrt {\cot (c+d x)} \sqrt {a+i a \tan (c+d x)} \, dx=\int \sqrt {\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}} \,d x \]

[In]

int(cot(c + d*x)^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2),x)

[Out]

int(cot(c + d*x)^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2), x)